﻿@{
    ViewBag.Title = "品名管理";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
<!--这里是高级查询区域-->
<div id="advQueryPanel" class="advQuery">
    <form>
    <table cellpadding="3" cellspacing="0" width="100%">
        <tr>
            <td class="firsttd">
                品名编号:
            </td>
            <td>
                @Html.TextBox("Code").ForSearch(QueryMethod.Equal)
            </td>
        </tr>
        <tr>
            <td class="firsttd">
                品名名称:
            </td>
            <td>
                @Html.TextBox("Name").ForSearch(QueryMethod.Like)
            </td>
        </tr>
        <tr>
            <td class="firsttd">
                品名大类:
            </td>
            <td>
                @Html.DWZDropDownList("Category", "MaterialCategory").ForSearch(QueryMethod.Equal)
            </td>
        </tr>
        <tr>
            <td class="firsttd">
                品名规格:
            </td>
            <td>
                @Html.DWZDropDownList("Specification", "MaterialSpec").ForSearch(QueryMethod.Equal)
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <a id="btnAdvQuery" class="button" href="javascript:void(0);"><span>查 询</span></a>
                <a id="btnAdvCancel" class="button" href="javascript:void(0);"><span>取 消</span></a>
            </td>
        </tr>
    </table>
    </form>
</div>
<div class="clear">
</div>
@(       
 Html.DWZGridFor<Material>()
    .Title("品名管理")
    .Action(@Url.Action("List"))
    .Columns(col =>
    {
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.Code).Width(60).AsQuery().AsSearch();
        col.Bind(e => e.Name).Width(100).AsQuery().Align(FlexiGridAlign.Left);
        col.Bind(e => e.Type).Width(50).EnumKey("MaterialType");
        col.Bind(e => e.Category).Width(50).EnumKey("MaterialCategory");
        col.Bind(e => e.Specification).Width(50).EnumKey("MaterialSpec");
        col.Bind(e => e.Unit).Width(50).EnumKey("MaterialUnit");
        col.Bind(e => e.CurrentPrice).Width(50).Align(FlexiGridAlign.Right);
        //col.Bind(e => e.ActualSorage).Width(80).Align(FlexiGridAlign.Right);
        col.Bind(e => e.SafeStorage).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.RawMaterialId).EnumKey("Material").Width(100).Align(FlexiGridAlign.Left);
        col.Bind(e => e.ProcessRate).Width(40).Align(FlexiGridAlign.Right);
        col.Bind(e => e.Id, "操作", 120).Sortable(false)
            .Template(Url.EditLinkTwo(Url.Action("Edit"), "编辑品名")
            + Url.DeleteLink("Delete", "${Name}"));
    })
    .Buttons(btn =>
    {
        btn.Bind("新建品名", FlexiGridButtonType.Add).Action(@Url.Action("Edit")).OnPress("AddNewTwo");
    })
)